package com.woniuxy.driverschool.service.courseArrangement;

import com.woniuxy.driverschool.entity.Student;
import com.woniuxy.driverschool.mapper.SchoolTimeTableMapper;
import com.woniuxy.driverschool.mapper.StudentMapper;
import com.woniuxy.driverschool.service.courseArrangement.parameterMessage.MessageForInsertIntoSchoolTimeTable;
import com.woniuxy.driverschool.service.courseArrangement.parameterMessage.MessageForScheduleLessons;
import com.woniuxy.driverschool.service.courseArrangement.parameterMessage.PeriodType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shichen
 * @create 2021-09-29-14:42
 *  给教练排课
 */

@Service
public class ScheduleLessonsForStu {



    @Autowired
    StudentMapper studentMapper;


    public List<Student> selectStudent(String stuName){
        Integer pageIndex = 1;
        Integer pageEnd = 10;

        List<Student> students = studentMapper.selectStudentsByPage(new Student().setSname(stuName), 1, 5, null, null, null, null);
        return students;
    }

    public void setCourse(MessageForScheduleLessons message) {
        //非空判断
        if (message.getInterval() != null) {
            List<PeriodType> list = message.getInterval();
            for (PeriodType period : list) {
                System.out.println(1);
                //每有一个条数据向数据库加一条数据
//                schoolTimeTableMapper.insertLesson(
//                        new MessageForInsertIntoSchoolTimeTable(message.getTeacherid(), message.getDate(), period));
            }
        }


    }


}
